import request from '@/utils/request'

export default {
  listPage(currentPage, pageSize, queryTrainingLevelDTO) {
    return request({
      url: `/trainingLevel/listSearch/${currentPage}/${pageSize}`,
      method: 'post',
      data: queryTrainingLevelDTO
    })
  },
  add(training) {
    return request({
      url: `/trainingLevel/insertOrUpdate`,
      method: 'post',
      data: training
    })
  },
  deleteOneTrainingLevel(id) {
    return request({
      url: `/trainingLevel/delete/${id}`,
      method: 'post'
    })
  },
  deleteSelectTrainingLevel(ids) {
    return request({
      url: `/trainingLevel/deleteBatch`,
      method: 'delete',
      data: ids
    })
  },
  listAll() {
    return request({
      url: `/trainingLevel/list`,
      method: 'get'
    })
  },
  nameIsExit(name) {
    return request({
      url: `/trainingLevel/nameOnly/${name}`,
      method: 'get'
    })
  },
  nameIsExit2(name) {
    return request({
      url: `/trainingLevel/nameOnly2/${name}`,
      method: 'get'
    })
  },
  idIsExit(id) {
    return request({
      url: `/trainingLevel/idOnly/${id}`,
      method: 'get'
    })
  },
  selectTrainingLevelById(id) {
    return request({
      url: `trainingLevel/select/${id}`,
      method: 'get'
    })
  }
}

